from sqlalchemy import Column, DateTime, Integer, String
from sqlalchemy.ext.declarative import declarative_base

# 创建 SQLAlchemy 基类
Base = declarative_base()

class CustomHistory(Base):
    """用户模型类，对应数据库中的 user 表。"""
    # 表名
    __tablename__ = "custom_history"

    # 用户 ID，主键，自增
    id = Column(Integer, primary_key=True, index=True)
    open_id = Column(String, unique=True, nullable=False)
    condition = Column(String, nullable=False)
    result = Column(DateTime, nullable=False)
    create_time = Column(DateTime, nullable=False)
